#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    connect(ui->MyButton,&QPushButton::clicked,this,&Widget::handleclick);
}

void Widget::handleclick()
{
    if(ui->MyButton->text() == QString("hello A"))
           ui->MyButton->setText("hello B");
    else
           ui->MyButton->setText("hello A");
}

Widget::~Widget()
{
    delete ui;
}

